import request from '@/utils/request';
import type {GoodsSkusQuery, GoodsSkusVO} from "@/api/home/goodsSkus/types";
import type {AxiosPromise} from "axios";
import type {MallGoodsVO} from "@/api/home/mallGoods/types";

/**
 * 查询商品一级分类列表
 */

export const categoryOneApi = () => {
  return request({
    url: '/api/index/cateOne',
    method: 'get',
  });
};
/*TODO 根据SKU查询热销商品，暂时不用此方法*/
export const hotGoodsSkusApi = (query?: GoodsSkusQuery): AxiosPromise<GoodsSkusVO[]> => {
  return request({
    url: '/api/index/goods',
    method: 'get',
    params: query
  });
};
/*查询询热销商品、最新商品*/
export const hotGoodsApi = (query?: GoodsSkusQuery): AxiosPromise<MallGoodsVO[]> => {
  return request({
    url: '/api/index/goodsHot',
    method: 'get',
    params: query
  });
};
/*查询首页商品*/
export const cate1IdApi = (id: string | number) => {
  return request({
    url: `/api/index/goods/list/${id}`,
    method: 'get',
  });
};


